package erfgame.core.world.terrain.async;

import java.awt.Point;


import erfgame.core.Point3D;
import erfgame.core.Point3DAndRotation;
import erfgame.core.dao.ObjectDAO;
import erfgame.core.entity.Entity;
import erfgame.core.memory.Pointer;
import erfgame.core.world.World;
import erfgame.core.world.WorldDAO;
import erfgame.core.world.WorldDAOManager;
import erfgame.core.world.terrain.BlockEntityPositions;
import erfgame.core.world.terrain.BlockGridTiles;
import erfgame.core.world.terrain.BlockSurfaceImages;

public class SynchronizingWorldDAOManagerProxy implements WorldDAOManager {
	
	private WorldDAOManager proxied;
	
	public SynchronizingWorldDAOManagerProxy( WorldDAOManager proxied ) {
		this.proxied = proxied;
	}

	public ObjectDAO<Point3DAndRotation, BlockSurfaceImages> getBlockSurfaceImagesDAO(
			World world) {
		return new SynchronizingObjectDAOProxy<Point3DAndRotation, BlockSurfaceImages>(
				proxied.getBlockSurfaceImagesDAO(world)
		);
	}

	public ObjectDAO<Point3D, Pointer<byte[][][]>> getBlockTerrainDAO(World world) {
		return new SynchronizingObjectDAOProxy<Point3D, Pointer<byte[][][]>>(
				proxied.getBlockTerrainDAO(world)
		);
	}

	public ObjectDAO<Long, Entity> getEntityDAO(World world) {
		return new SynchronizingObjectDAOProxy<Long, Entity>(
				proxied.getEntityDAO(world)
		);
	}

	public ObjectDAO<Point, BlockGridTiles> getGridTilesDAO(World world) {
		return new SynchronizingObjectDAOProxy<Point, BlockGridTiles>(
				proxied.getGridTilesDAO(world)
		);
	}

	public ObjectDAO<Point, int[][][]> getSurfacesDAO(World world) {
		return new SynchronizingObjectDAOProxy<Point, int[][][]>(
				proxied.getSurfacesDAO(world)
		);
	}
	
	public ObjectDAO<Point3D, BlockEntityPositions> getBlockEntityPositionsDAO(
			World world) {
		return new SynchronizingObjectDAOProxy<Point3D, BlockEntityPositions>(
				proxied.getBlockEntityPositionsDAO(world)
		);
	}

	public WorldDAO getWorldDAO() {
		return proxied.getWorldDAO();
	}

}
